******************************************************************
**************"Taxing the Wealthy in Haiti"***********************
*******Authors: Ana I. Lopez Garcia & Sarah Berens****************
******************************************************************

*FIGURES
*Figure 1. Conjoint Experiment: AMCEs of attributes on the selection of tax proposals ///
	by respondent's affluence. 
*Figure 2. Analysis of the difference before and after the outbreak of gang-driven violence ///
	in Haiti and preferences for property tax reform proposals
*Figure A1. AMCE results for the average respondent (Table A3)
*Figure A2. Conjoint Experiment: AMCEs of attributes on the selection of tax proposals ///
	by respondent's affluent status and gang presence in the neighbourhood.
*Figure A3. Conjoint Experiment: Marginal Means (MM) of attributes on the selection of ///
	tax proposals for the average respondent (no weights).
*Figure A4. Conjoint Experiment: Marginal Means (MM) of attributes on the selection of ///
	tax proposals by respondent's socio-economic status (no weights)
*Figure A5. Conjoint Experiment: Robustness Test: AMCEs of attributes on the selection ///
	of tax proposals by respondent's affluent status and excluding each conjoint round, sample weights
*Figure A6. Conjoint Experiment: Robustness Test: AMCEs of attributes on the selection ///
	of tax proposals by respondent's affluent status, controlling for randomization of attributes
*Figure A7. Conjoint Experiment: Robustness Test: AMCEs of attributes on the selection ///
	of tax proposals by respondent's affluent status, excluding long-takers
*Figure A8: Covariate balance across treatment and control groups after gang insurrection
*Figure A9. Conjoint Experiment: Robustness Test: AMCEs of attributes on the selection ///
	of tax proposals by respondent's affluent status, after matching respondents using entropy balancing
*Figure A10. Conjoint Experiment: Robustness Test: AMCEs of attributes on the selection ///
	of tax proposals by respondent's affluent status, exclusion window 7 and 14  days before/after gang upheaval


******************************************************************
*Set working directory 

use "haiti_conjoint.dta", clear

label define collects_ 0 "bureaucrats" 1 "community leaders" 2 "local church" 3 "local NGOs" 4 "foreign NGOs", modify
label values collects_ collects_

label define university 1 "affluent" 0 "not affluent" , modify
label values university university
	
******************************************************************	
*Plot style
grstyle init 
grstyle set plain, nogrid
grstyle set color mono
grstyle set legend, nobox
grstyle numstyle legend_rows 1
graph set window fontface "Arial"

grstyle set graphsize 8.5 7.5 

********************************************************************
*Figure 1. Conjoint Experiment: AMCEs of attributes on the selection of tax proposals ///
	by respondent's affluence. 
grstyle set graphsize 8.5 7.5 
logit evaluation_ i.admin_##i.university i.collects_##i.university  i.recognition_##i.university  i.beneficiary_##i.university  i.purpose_##i.university ///
	i.improvement_##i.university   if  university == 0  [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames1

logit evaluation_ i.admin_##i.university  i.collects_##i.university ##i.university  i.recognition_##i.university  i.beneficiary_##i.university ///
	i.purpose_##i.university  i.improvement_##i.university   if  university == 1  [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames2

coefplot (ames1, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) ///
    (ames2, label(affluent) msymbol(O) level(95 90) ciopts(lcolor(black)) ///
    mlcolor(black) mfcolor(white) mlabposition(center)), ///
    xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) ///
    baselevels drop(_cons) ///
    xtitle("{bf:Estimated AMCEs}", margin(l+0 r+0 b+0 t+3)) ///
    scale(0.65) ///
    headings(0.admin_ = "{bf: Tax authority}" ///
             0.collects_ = "{bf:Tax collectors}" ///
             0.purpose_ = "{bf:Tax earmarking}" ///
             0.improvement_ = "{bf:Discount rates}" ///
             0.beneficiary_ = "{bf:Beneficiaries}" ///
             0.recognition_ = "{bf:Taxpayer recognition}") ///
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium)) 
	
	graph save "Figure_1.gph", replace 
	graph export "Figure_1.eps", as(eps) replace 
	graph export "Figure_1.tif", as(tif) replace 
	graph export "Figure_1.png", as(png) replace	
	graph export "Figure_1.pdf", as(pdf) replace 
	graph export "Figure_1.svg", as(svg) replace	
	graph export "Figure_1.jpg", as(jpg) replace
	
********************************************************************************
*Figure 2. Analysis of the difference before and after the outbreak of gang-driven violence ///
	in Haiti and preferences for property tax reform proposals
logit evaluation_ i.admin_##i.university##i.president i.collects_##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president  i.purpose_##i.university##i.president ///
	i.improvement_##i.university##i.president   if  president == 0 & university == 0  [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames1

logit evaluation_ i.admin_##i.university##i.president  i.collects_##i.university##i.president ##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president ///
	i.purpose_##i.university##i.president  i.improvement_##i.university##i.president   if  president == 0 & university == 1 [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames2

logit evaluation_ i.admin_##i.university##i.president i.collects_##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president  i.purpose_##i.university##i.president ///
	i.improvement_##i.university##i.president   if  president == 1 & university == 0  [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames3
	
logit evaluation_ i.admin_##i.university##i.president  i.collects_##i.university##i.president ##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president ///
	i.purpose_##i.university##i.president  i.improvement_##i.university##i.president   if  president == 1 & university == 1 [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames4

grstyle set graphsize 8.5 7.5 

coefplot (ames1, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) ///
    (ames2, label(affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), ///
    xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) ///
    baselevels drop(_cons) ///
    title("{bf: Before}", margin(b+3 t+0 l+0 r+0)) ///
    xtitle("") ///
    scale(0.75) ///
    headings(0.admin_ = "{bf: Tax authority}" ///
             0.collects_ = "{bf:Tax collectors}" ///
             0.purpose_ = "{bf:Tax earmarking}" ///
             0.improvement_ = "{bf:Discount rates}" ///
             0.beneficiary_ = "{bf:Beneficiaries}" ///
             0.recognition_ = "{bf:Taxpayer recognition}") ///
    xlab(-0.4(0.1)0.4) ///
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium))

	graph save "Figure_2a.gph", replace 
	
	
coefplot (ames3, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) ///
    (ames4, label(affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), ///
    xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) ///
    baselevels drop(_cons) ///
    title("{bf:  After}", margin(b+3 t+0 l+0 r+0)) ///
    xtitle("") ///
    scale(0.75) ///
    headings(0.admin_ = "{bf: Tax authority}" ///
             0.collects_ = "{bf:Tax collectors}" ///
             0.purpose_ = "{bf:Tax earmarking}" ///
             0.improvement_ = "{bf:Discount rates}" ///
             0.beneficiary_ = "{bf:Beneficiaries}" ///
             0.recognition_ = "{bf:Taxpayer recognition}") ///
    xlab(-0.4(0.1)0.4) ///
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium)) 
	
	graph save "Figure_2b.gph", replace 

grstyle set graphsize 7.5 11.75
grc1leg2  "Figure_2a.gph" "Figure_2b.gph", xcommon ycommon legendfrom("Figure_2a.gph") cols(2) labsize(vsmall) scale(0.95)
	graph save "Figure_2.gph", replace 
	graph export "Figure_2.eps", as(eps) replace 
	graph export "Figure_2.tif", as(tif) replace 
	graph export "Figure_2.png", as(png)  replace	
	graph export "Figure_2.pdf", as(pdf) replace 
	graph export "Figure_2.svg", as(svg) replace	
	graph export "Figure_2.jpg", as(jpg) replace	

********************************************************************************
*Figure A1. AMCE results for the average respondent (Table A3)

logit evaluation_ i.admin_ i.collects_ i.recognition_ i.beneficiary_ i.purpose_ i.improvement_  [pweight = weight], cluster(id)
margins, dydx(*) post 
est 	store ames0

coefplot (ames0, level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), ///
    xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) ///
    baselevels drop(_cons) ///
    xtitle("{bf:Estimated AMCEs}", margin(l+0 r+0 b+0 t+3)) ///
    xlab(-0.1(0.02).1) ///
    scale(0.65) ///
    headings(0.admin_ = "{bf: Tax authority}" ///
             0.collects_ = "{bf:Tax collectors}" ///
             0.purpose_ = "{bf:Tax earmarks}" ///
             0.improvement_ = "{bf:Visibility of results}" ///
             0.beneficiary_ = "{bf:Beneficiaries}" ///
             0.recognition_ = "{bf:Taxpayer recognition}") ///
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium)) 
	graph save "Figure_A1.gph", replace 
	graph export "Figure_A1.eps", as(eps) replace 
	graph export "Figure_A1.tif", as(tif) replace 
	graph export "Figure_A1.png", as(png) replace	
	graph export "Figure_A1.wmf", as(wmf) replace
	graph export "Figure_A1.pdf", as(pdf) replace 
	graph export "Figure_A1.svg", as(svg) replace	
	graph export "Figure_A1.jpg", as(jpg) replace


********************************************************************************
**Figure A2. Conjoint Experiment: AMCEs of attributes on the selection of tax proposals ///
	by respondent's affluent status and gang presence in the neighbourhood.

logit evaluation_ i.admin_##i.university##i.gang i.collects_##i.university##i.gang  i.recognition_##i.university##i.gang  i.beneficiary_##i.university##i.gang  i.purpose_##i.university##i.gang ///
	i.improvement_##i.university##i.gang   if  gang == 0 & university == 0  [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames1

logit evaluation_ i.admin_##i.university##i.gang  i.collects_##i.university##i.gang ##i.university##i.gang  i.recognition_##i.university##i.gang  i.beneficiary_##i.university##i.gang ///
	i.purpose_##i.university##i.gang  i.improvement_##i.university##i.gang   if  gang == 0 & university == 1 [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames2

logit evaluation_ i.admin_##i.university##i.gang i.collects_##i.university##i.gang  i.recognition_##i.university##i.gang  i.beneficiary_##i.university##i.gang  i.purpose_##i.university##i.gang ///
	i.improvement_##i.university##i.gang   if  gang == 1 & university == 0  [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames3
	
logit evaluation_ i.admin_##i.university##i.gang  i.collects_##i.university##i.gang ##i.university##i.gang  i.recognition_##i.university##i.gang  i.beneficiary_##i.university##i.gang ///
	i.purpose_##i.university##i.gang  i.improvement_##i.university##i.gang   if  gang == 1 & university == 1 [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames4

cd "C:\Users\p70076949\Dropbox\ICTD - Haiti\Results\Plots\" 

grstyle set graphsize 8.5 7.5 
coefplot  (ames1, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) ///
	(ames2, label(affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) baselevels  ///
	drop(_cons) ///
	title("{bf: No gang presence}", margin(b+3 t+0 l+0 r+0)) ///
	xtitle("") ///
	scale(0.75) ///
	headings(0.admin_ = "{bf: Tax authority}" ///
	0.collects_ = "{bf:Tax collectors}" ///
	0.purpose_ = "{bf:Tax earmarking}" ///
	0.improvement_ = "{bf:Discount rates}" ///
	0.beneficiary_ = "{bf:Beneficiaries}" ///
	0.recognition_ = "{bf:Taxpayer recognition}") /// 
	xlab(-0.4(0.2)0.4) ///
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium)) 
	graph save "Figure_A2a.gph", replace 
	
	
coefplot  (ames3, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) /// 
	(ames4, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) baselevels  ///
	drop(_cons) ///
	title("{bf: Gang presence}", margin(b+3 t+0 l+0 r+0)) ///
	xtitle("") ///
	scale(0.75) ///
	headings(0.admin_ = "{bf: Tax authority}" ///
	0.collects_ = "{bf:Tax collectors}" ///
	0.purpose_ = "{bf:Tax earmarking}" ///
	0.improvement_ = "{bf:Discount rates}" ///
	0.beneficiary_ = "{bf:Beneficiaries}" ///
	0.recognition_ = "{bf:Taxpayer recognition}") /// 
    ciopts(recast(rspike)) ///
	xlab(-0.4(0.2)0.4) ///
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium)) 
	graph save "Figure_A2b.gph", replace 

grstyle set graphsize 7.5 11.75

grc1leg2  "Figure_A2a.gph" "Figure_A2b.gph", xcommon ycommon legendfrom("Figure_A2a.gph") cols(2) labsize(vsmall) scale(0.95)
	graph save "Figure_A2.gph", replace 
	graph export "Figure_A2.eps", as(eps) replace 
	graph export "Figure_A2.tif", as(tif) replace 
	graph export "Figure_A2.png", as(png)  replace	
	graph export "Figure_A2.pdf", as(pdf) replace 
	graph export "Figure_A2.svg", as(svg) replace	
	graph export "Figure_A2.jpg", as(jpg) replace
	
********************************************************************************	
** Figure A3. Conjoint Experiment: Marginal Means (MM) of attributes on the selection of tax proposals for the average respondent (no weights).	
grstyle set graphsize 8.5 7.5 
conjoint evaluation_ admin_ collects_ recognition_ beneficiary_ purpose_ improvement_  ,  est(mm) id(id) 
conjoint, graph 
	graph save FigA3_MM.gph, replace
	graph export FigA3_MM.pdf, as(pdf) replace	
	graph save "Figure_A3.gph", replace 
	graph export "Figure_A3.eps", as(eps) replace 
	graph export "Figure_A3.tif", as(tif) replace 
	graph export "Figure_A3.png", as(png)  replace	
	graph export "Figure_A3.pdf", as(pdf) replace 
	graph export "Figure_A3.svg", as(svg) replace	
	graph export "Figure_A3.jpg", as(jpg) replace

********************************************************************************	
*Figure A4. Conjoint Experiment: Marginal Means (MM) of attributes on the selection of ///
	tax proposals by respondent's socio-economic status (no weights)
grstyle set graphsize 8.5 7.5 
conjoint evaluation_ admin_ collects_ recognition_ beneficiary_ purpose_ improvement_  , subgroup(university) est(mm) id(id) 
conjoint, graph 
	graph save FigA4_MM.gph, replace
	graph export FigA4_MM.pdf, as(pdf) replace	
	graph save "Figure_A4.gph", replace 
	graph export "Figure_A4.eps", as(eps) replace 
	graph export "Figure_A4.tif", as(tif) replace 
	graph export "Figure_A4.png", as(png)  replace	
	graph export "Figure_A4.pdf", as(pdf) replace 
	graph export "Figure_A4.svg", as(svg) replace	
	graph export "Figure_A4.jpg", as(jpg) replace
	
********************************************************************************
*Figure A5. Conjoint Experiment: Robustness Test: AMCEs of attributes on the selection of ///
	tax proposals by respondent's affluent status and excluding each conjoint round, sample weights
grstyle set graphsize 8.5 7.5 
preserve 
drop if card == "a_1"
drop if card == "b_1"
logit evaluation_ i.admin_##i.university i.collects_##i.university  i.recognition_##i.university  i.beneficiary_##i.university  i.purpose_##i.university ///
	i.improvement_##i.university if  university == 0 [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store R1notaffluent
logit evaluation_ i.admin_##i.university i.collects_##i.university  i.recognition_##i.university  i.beneficiary_##i.university  i.purpose_##i.university ///
	i.improvement_##i.university if  university == 1 [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store R1affluent
restore 

preserve 
drop if card == "a_2"
drop if card == "b_2"
logit evaluation_ i.admin_##i.university i.collects_##i.university  i.recognition_##i.university  i.beneficiary_##i.university  i.purpose_##i.university ///
	i.improvement_##i.university if  university == 0 [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store R2notaffluent
logit evaluation_ i.admin_##i.university i.collects_##i.university  i.recognition_##i.university  i.beneficiary_##i.university  i.purpose_##i.university ///
	i.improvement_##i.university if  university == 1 [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store R2affluent
restore

preserve 
drop if card == "a_3"
drop if card == "b_3"
logit evaluation_ i.admin_##i.university i.collects_##i.university  i.recognition_##i.university  i.beneficiary_##i.university  i.purpose_##i.university ///
	i.improvement_##i.university if  university == 0 [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store R3notaffluent
logit evaluation_ i.admin_##i.university i.collects_##i.university  i.recognition_##i.university  i.beneficiary_##i.university  i.purpose_##i.university ///
	i.improvement_##i.university if  university == 1 [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store R3affluent
restore

grstyle set graphsize 7.5 11.75
coefplot (R1notaffluent, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) /// 
	(R1affluent, level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), bylabel(Excl. R1)  || ///
	(R2notaffluent, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) ///
	(R2affluent, label(affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), bylabel(Excl. R2) || /// 
	(R3notaffluent, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) ///
	(R3affluent, label(affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), bylabel(Excl. R3) ||, ///  
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) baselevels  ///
	drop(_cons) byopts(compact rows(1)) ///
	xtitle("") ///
	headings(0.admin_ = "{bf: Tax authority}" ///
	0.collects_ = "{bf:Tax collectors}" ///
	0.purpose_ = "{bf:Tax earmarking}" ///
	0.improvement_ = "{bf:Discount rates}" ///
	0.beneficiary_ = "{bf:Beneficiaries}" ///
	0.recognition_ = "{bf:Taxpayer recognition}") /// 
	ciopts(recast(rspike)) ///
	mlabposition(center) ///
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium)) ///
	xlab(-.3(0.1).3) ///
	scale(0.65)

	graph save "Figure_A5.gph", replace 
	graph export "Figure_A5.eps", as(eps) replace 
	graph export "Figure_A5.tif", as(tif) replace 
	graph export "Figure_A5.png", as(png)  replace		
	graph export "Figure_A5.pdf", as(pdf) replace 
	graph export "Figure_A5.svg", as(svg) replace	
	graph export "Figure_A5.jpg", as(jpg) replace		

********************************************************************************
**Figure A6. Conjoint Experiment: Robustness Test: AMCEs of attributes on the selection ///
	of tax proposals by respondent's affluent status, controlling for randomization of attributes

set matsize 11000
encode q01_t01_order , gen(order_r1)
encode q02_t02_order , gen(order_r2)
encode q03_t03_order , gen(order_r3)
	
qui logit evaluation_ i.admin_##i.university i.collects_##i.university i.recognition_##i.university i.beneficiary_##i.university i.purpose_##i.university ///
	i.improvement_##i.university i.order_r1 i.order_r2 i.order_r3 if university == 0 [pweight=weight], cluster(id)
eststo ames1

qui logit evaluation_ i.admin_##i.university i.collects_##i.university i.recognition_##i.university i.beneficiary_##i.university i.purpose_##i.university ///
	i.improvement_##i.university i.order_r1 i.order_r2 i.order_r3 if university == 1 [pweight=weight], cluster(id)
eststo ames2

grstyle set graphsize 8.5 7.5 
coefplot  (ames1, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) ///
	(ames2, label(affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), ///
	keep(0.admin_ 1.admin_ 0.collects_ 1.collects_ 2.collects_ 3.collects_ 4.collects_ 0.recognition_ 1.recognition_ 2.recognition_ 3.recognition_ 4.recognition_ ///
	0.beneficiary 1.beneficiary_ 2.beneficiary_ 3.beneficiary_ 4.beneficiary_ 0.purpose_ 1.purpose_ 2.purpose_ 3.purpose_ 4.purpose ///
	0.improvement_ 1.improvement_ 2.improvement_ 3.improvement_ 4.improvement_) ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) baselevels  ///
	title("") ///
	xtitle("") ///
	scale(0.75) ///
	headings(0.admin_ = "{bf: Tax authority}" ///
	0.collects_ = "{bf:Tax collectors}" ///
	0.purpose_ = "{bf:Tax earmarking}" ///
	0.improvement_ = "{bf:Discount rates}" ///
	0.beneficiary_ = "{bf:Beneficiaries}" ///
	0.recognition_ = "{bf:Taxpayer recognition}") /// 
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium)) 
	graph save "Figure_A6.gph", replace 
	graph export "Figure_A6.eps", as(eps) replace 
	graph export "Figure_A6.tif", as(tif) replace 
	graph export "Figure_A6.png", as(png)  replace	
	graph export "Figure_A6.pdf", as(pdf) replace 
	graph export "Figure_A6.svg", as(svg) replace	
	graph export "Figure_A6.jpg", as(jpg) replace
	
********************************************************************************
**Figure A7. Conjoint Experiment: Robustness Test: AMCEs of attributes on the selection ///
	of tax proposals by respondent's affluent status, excluding long-takers
 
	
grstyle set graphsize 8.5 7.5 
logit evaluation_ i.admin_##i.university i.collects_##i.university  i.recognition_##i.university  i.beneficiary_##i.university  i.purpose_##i.university ///
	i.improvement_##i.university i.time_outliers  if  university == 0  [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames1

logit evaluation_ i.admin_##i.university  i.collects_##i.university ##i.university  i.recognition_##i.university  i.beneficiary_##i.university ///
	i.purpose_##i.university  i.improvement_##i.university i.time_outliers if  university == 1  [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames2

coefplot  (ames1, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) ///
	(ames2, label(affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) baselevels  ///
	drop(_cons) ///
	xtitle("bf:{Estimated AMCEs}", margin(b+0 t+3 l+0 r+0)) ///
	scale(0.70) ///
	headings(0.admin_ = "{bf: Tax authority}" ///
	0.collects_ = "{bf:Tax collectors}" ///
	0.purpose_ = "{bf:Tax earmarking}" ///
	0.improvement_ = "{bf:Discount rates}" ///
	0.beneficiary_ = "{bf:Beneficiaries}" ///
	0.recognition_ = "{bf:Taxpayer recognition}") /// 
	ciopts(recast(rspike)) ///
	mlabposition(center) ///
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium)) 
	

********************************************************************************
	
grstyle set graphsize 8.5 7.5 
logit evaluation_ i.admin_##i.university i.collects_##i.university  i.recognition_##i.university  i.beneficiary_##i.university  i.purpose_##i.university ///
	i.improvement_##i.university i.time_outliers  if  university == 0  & time_outliers  == 0 [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames1

logit evaluation_ i.admin_##i.university  i.collects_##i.university ##i.university  i.recognition_##i.university  i.beneficiary_##i.university ///
	i.purpose_##i.university  i.improvement_##i.university i.time_outliers if  university == 1 & time_outliers  == 0 [pweight = weight], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames2

coefplot  (ames1, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) ///
	(ames2, label(affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) baselevels  ///
	drop(_cons) ///
	xtitle("{bf:Estimated AMCEs}", margin(b+0 t+3 l+0 r+0)) ///
	scale(0.70) ///
	headings(0.admin_ = "{bf: Tax authority}" ///
	0.collects_ = "{bf:Tax collectors}" ///
	0.purpose_ = "{bf:Tax earmarking}" ///
	0.improvement_ = "{bf:Discount rates}" ///
	0.beneficiary_ = "{bf:Beneficiaries}" ///
	0.recognition_ = "{bf:Taxpayer recognition}") /// 
	ciopts(recast(rspike)) ///
	mlabposition(center) ///
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium)) 
	
	graph save "Figure_A7.gph", replace 
	graph export "Figure_A7.eps", as(eps) replace 
	graph export "Figure_A7.tif", as(tif) replace 
	graph export "Figure_A7.png", as(png)  replace	
	graph export "Figure_A7.pdf", as(pdf) replace 
	graph export "Figure_A7.svg", as(svg) replace	
	graph export "Figure_A7.jpg", as(jpg) replace

********************************************************************************
**Figure A8: Covariate balance across treatment and control groups after gang insurrection

*Balance table & plot 
grstyle set graphsize 4 6 
balanceplot  E3 i.female i.age_cat i.university i.civil_status i.employed i.race i.remittances, group(president) ///
	graphop(title("{bf: Gang insurrection}", size(medlarge) margin(b+2 t+0 l+0 r+0)) ///
	title("{bf: Gang insurrection}", size(medlarge) margin(b+1 t+0 l+0 r+0)) ///
	subtitle("Before vs After", size(medsmall) margin(b+3 t+0 l+0 r+0)) /// 	
	xlabel(-15(5)15) ///	
	scale (0.75) ///	
	xtitle("          % Standardized Difference", margin(b+0 t+2 l+0 r+0) size(medsmall))) /// 
	base(1) ref(0)  
graph save "Figure_A8.gph", replace 
	graph export "Figure_A8.eps", as(eps) replace 
	graph export "Figure_A8.tif", as(tif) replace 
	graph export "Figure_A8.png", as(png) replace	
	graph export "Figure_A8.jpg", as(jpg) replace 
	graph export "Figure_A8.svg", as(svg) replace
	graph export "Figure_A8.pdf", as(pdf) replace



********************************************************************************
**Figure A9. Conjoint Experiment: Robustness Test: AMCEs of attributes on the selection ///
	of tax proposals by respondent's affluent status, after matching respondents using entropy balancing
	
ebalance president i.female c.age c.education i.civil_status i.employed i.race i.remittances, basew(weight)

grstyle set graphsize 8.5 7.5 

logit evaluation_ i.admin_##i.university##i.president i.collects_##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president  i.purpose_##i.university##i.president ///
	i.improvement_##i.university##i.president   if  president == 0 & university == 0  [iweight = _webal], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames1

logit evaluation_ i.admin_##i.university##i.president  i.collects_##i.university##i.president ##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president ///
	i.purpose_##i.university##i.president  i.improvement_##i.university##i.president   if  president == 0 & university == 1 [iweight = _webal], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames2

logit evaluation_ i.admin_##i.university##i.president i.collects_##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president  i.purpose_##i.university##i.president ///
	i.improvement_##i.university##i.president   if  president == 1 & university == 0  [iweight = _webal], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames3
	
logit evaluation_ i.admin_##i.university##i.president  i.collects_##i.university##i.president ##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president ///
	i.purpose_##i.university##i.president  i.improvement_##i.university##i.president   if  president == 1 & university == 1 [iweight = _webal], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames4

cd "C:\Users\p70076949\Dropbox\ICTD - Haiti\Results\Plots\" 

coefplot  (ames1, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) ///
	(ames2, level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) baselevels  ///
	drop(_cons) ///
	title("{bf: Before}", margin(b+3 t+0 l+0 r+0)) ///
	xtitle("") ///
	scale(0.75) ///
	headings(0.admin_ = "{bf: Tax authority}" ///
	0.collects_ = "{bf:Tax collectors}" ///
	0.purpose_ = "{bf:Tax earmarking}" ///
	0.improvement_ = "{bf:Discount rates}" ///
	0.beneficiary_ = "{bf:Beneficiaries}" ///
	0.recognition_ = "{bf:Taxpayer recognition}") /// 
    ciopts(recast(rspike)) ///
	xlab(-0.4(0.2)0.4) ///
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium)) 
	graph save "Figure_A9a.gph", replace 
	
	
coefplot  (ames3, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) ///
	(ames4, label(affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) baselevels  ///
	drop(_cons) ///
	title("{bf: After}", margin(b+3 t+0 l+0 r+0)) ///
	xtitle("") ///
	scale(0.75) ///
	headings(0.admin_ = "{bf: Tax authority}" ///
	0.collects_ = "{bf:Tax collectors}" ///
	0.purpose_ = "{bf:Tax earmarking}" ///
	0.improvement_ = "{bf:Discount rates}" ///
	0.beneficiary_ = "{bf:Beneficiaries}" ///
	0.recognition_ = "{bf:Taxpayer recognition}") /// 
    ciopts(recast(rspike)) ///
	xlab(-0.4(0.2)0.4) ///
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium)) 
	graph save "Figure_A9b.gph", replace 

grstyle set graphsize 7.5 11.75

grc1leg2  "Figure_A9a.gph" "Figure_A9b.gph", xcommon ycommon legendfrom("Figure_A9a.gph") cols(2) labsize(vsmall) scale(0.90)

	graph save "Figure_A9.gph", replace 
	graph export "Figure_A9.eps", as(eps) replace 
	graph export "Figure_A9.tif", as(tif) replace 
	graph export "Figure_A9.png", as(png)  replace	
	graph export "Figure_A9.wmf", as(wmf) replace	
	graph export "Figure_A9.pdf", as(pdf) replace 
	graph export "Figure_A9.svg", as(svg) replace	
	graph export "Figure_A9.jpg", as(jpg) replace
	
********************************************************************************
*Figure A10. Conjoint Experiment: Robustness Test: AMCEs of attributes on the selection ///
	of tax proposals by respondent's affluent status, exclusion window 7 and 14  days before/after gang upheaval

* Changing treatment dates +/- 15 days 
* The value of days when insurrection occurred is 80

preserve 

drop if days >= 73 & days <= 87

logit evaluation_ i.admin_##i.university##i.president i.collects_##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president  i.purpose_##i.university##i.president ///
	i.improvement_##i.university##i.president   if  president == 0 & university == 0  [iweight = _webal], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames1

logit evaluation_ i.admin_##i.university##i.president  i.collects_##i.university##i.president ##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president ///
	i.purpose_##i.university##i.president  i.improvement_##i.university##i.president   if  president == 0 & university == 1 [iweight = _webal], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames2

logit evaluation_ i.admin_##i.university##i.president i.collects_##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president  i.purpose_##i.university##i.president ///
	i.improvement_##i.university##i.president   if  president  == 1 & university == 0  [iweight = _webal], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames3
	
logit evaluation_ i.admin_##i.university##i.president  i.collects_##i.university##i.president ##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president ///
	i.purpose_##i.university##i.president  i.improvement_##i.university##i.president   if  president  == 1 & university == 1 [iweight = _webal], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames4

	
grstyle set graphsize 8.5 7.5 
coefplot  (ames1, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) ///
	(ames2, label(affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) baselevels  ///
	drop(_cons) ///
	title("{bf: Before}", margin(b+3 t+0 l+0 r+0)) ///
	xtitle("") ///
	scale(0.75) ///
	headings(0.admin_ = "{bf: Tax authority}" ///
	0.collects_ = "{bf:Tax collectors}" ///
	0.purpose_ = "{bf:Tax earmarking}" ///
	0.improvement_ = "{bf:Discount rates}" ///
	0.beneficiary_ = "{bf:Beneficiaries}" ///
	0.recognition_ = "{bf:Taxpayer recognition}") /// 
    ciopts(recast(rspike)) ///
	xlab(-0.4(0.2)0.4) ///
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium)) 
	graph save "Figure_excl1.gph", replace 
	
	
coefplot  (ames3, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) ///
	(ames4, label(affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) baselevels  ///
	drop(_cons) ///
	title("{bf: After}", margin(b+3 t+0 l+0 r+0)) ///
	xtitle("") ///
	scale(0.75) ///
	headings(0.admin_ = "{bf: Tax authority}" ///
	0.collects_ = "{bf:Tax collectors}" ///
	0.purpose_ = "{bf:Tax earmarking}" ///
	0.improvement_ = "{bf:Discount rates}" ///
	0.beneficiary_ = "{bf:Beneficiaries}" ///
	0.recognition_ = "{bf:Taxpayer recognition}") /// 
	xlab(-0.4(0.2)0.4) ///
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium)) 
	graph save "Figure_excl2.gph", replace 

grstyle set graphsize 7.5 11.75
grc1leg2  "Figure_excl1.gph" "Figure_excl2.gph", xcommon ycommon legendfrom("Figure_excl1.gph") cols(2) labsize(vsmall) ///
	title("{bf: 7 days before/after}", size(medsmall)) scale(0.9)
	graph save "Figure_A10a.gph", replace 

restore
********************************************************************************
preserve 

drop if days >= 66 & days <= 94

logit evaluation_ i.admin_##i.university##i.president i.collects_##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president  i.purpose_##i.university##i.president ///
	i.improvement_##i.university##i.president   if  president == 0 & university == 0  [iweight = _webal], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames1

logit evaluation_ i.admin_##i.university##i.president  i.collects_##i.university##i.president ##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president ///
	i.purpose_##i.university##i.president  i.improvement_##i.university##i.president   if  president == 0 & university == 1 [iweight = _webal], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames2

logit evaluation_ i.admin_##i.university##i.president i.collects_##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president  i.purpose_##i.university##i.president ///
	i.improvement_##i.university##i.president   if  president  == 1 & university == 0  [iweight = _webal], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames3
	
logit evaluation_ i.admin_##i.university##i.president  i.collects_##i.university##i.president ##i.university##i.president  i.recognition_##i.university##i.president  i.beneficiary_##i.university##i.president ///
	i.purpose_##i.university##i.president  i.improvement_##i.university##i.president   if  president  == 1 & university == 1 [iweight = _webal], cluster(id)
	margins, dydx(*) level(90) post 
	est 	store ames4

grstyle set graphsize 8.5 7.5 

coefplot  (ames1, label(not affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) ///
	(ames2, label(affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) baselevels  ///
	drop(_cons) ///
	title("{bf: Before}", margin(b+3 t+0 l+0 r+0)) ///
	xtitle("") ///
	scale(0.75) ///
	headings(0.admin_ = "{bf: Tax authority}" ///
	0.collects_ = "{bf:Tax collectors}" ///
	0.purpose_ = "{bf:Tax earmarking}" ///
	0.improvement_ = "{bf:Discount rates}" ///
	0.beneficiary_ = "{bf:Beneficiaries}" ///
	0.recognition_ = "{bf:Taxpayer recognition}") /// 
    ciopts(recast(rspike)) ///
	xlab(-0.4(0.2)0.4) ///
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium)) 
	graph save "Figure_excl3.gph", replace 
	
	
coefplot  (ames3, label(not affluent)level(95 90) ciopts(lcolor(black)) ///
    msymbol(X) mlcolor(black) mfcolor(white) mlabposition(center)) ///
	(ames4, label(affluent) level(95 90) ciopts(lcolor(black)) ///
    msymbol(O) mlcolor(black) mfcolor(white) mlabposition(center)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) baselevels  ///
	drop(_cons) ///
	title("{bf: After}", margin(b+3 t+0 l+0 r+0)) ///
	xtitle("") ///
	scale(0.75) ///
	headings(0.admin_ = "{bf: Tax authority}" ///
	0.collects_ = "{bf:Tax collectors}" ///
	0.purpose_ = "{bf:Tax earmarking}" ///
	0.improvement_ = "{bf:Discount rates}" ///
	0.beneficiary_ = "{bf:Beneficiaries}" ///
	0.recognition_ = "{bf:Taxpayer recognition}") /// 
    ciopts(recast(rspike)) ///
	xlab(-0.4(0.2)0.4) ///
    graphregion(color(white)) ///
    plotregion(fcolor(white) lcolor(black) lwidth(medium)) 
	graph save "Figure_excl4.gph", replace 

grstyle set graphsize 7.5 11.75

grc1leg2  "Figure_excl3.gph" "Figure_excl4.gph", xcommon ycommon legendfrom("Figure_excl3.gph") cols(2) labsize(vsmall) ///
	title("{bf: 14 days before/after}", size(medsmall)) scale(0.90)

	graph save "Figure_A10b.gph", replace 

grstyle set graphsize 18.5 16

graph combine "Figure_A10a.gph" "Figure_A10b.gph", cols(1) scale(0.9)
	graph save "Figure_A10.gph", replace 
	graph export "Figure_A10.eps", as(eps) replace 
	graph export "Figure_A10.tif", as(tif) replace 
	graph export "Figure_A10.png", as(png)  replace	
	graph export "Figure_A10.wmf", as(wmf) replace	
	graph export "Figure_A10.pdf", as(pdf) replace 
	graph export "Figure_A10.svg", as(svg) replace	
	graph export "Figure_A10.jpg", as(jpg) replace

eststo clear 

restore
